﻿<%@ Page Language="C#" MasterPageFile="~/SubForm.Master" AutoEventWireup="true" CodeBehind="LogViewer.aspx.cs" Inherits="PreContractWeb.Administration.LogViewer" %>
<%@ Register Src="../UserControl/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<script language="javascript" type="text/javascript">
	  
  
 
  	function   document.onkeydown()     
          {     
                  var   e=event.srcElement;     
                  if(event.keyCode==13)     
                  {     
                          document.all.ctl00$ContentPlaceHolder1$btnSearch.click();
                          return   false;     
                  }     
          } 
          
    
		
		    
    </script>
    
    <script language="javascript" type="text/javascript" src="../Javascript/Form.js"></script>
    <div id="divError" runat="server" style=" height:20;"></div>
<div id="divContent" runat="server" align="center">
        <table border="0" cellpadding="0" cellspacing="0" width="95%">
  <tr>
    <td width="100%" height="100%" valign="middle" align="center"><br />
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td class="panel_header">
                <!--标题-->
                <asp:Label ID="lb_hd1" runat="server">日志查询条件 (Log Search Condition)</asp:Label>
                <!--标题-->
                </td><td width="5" rowspan="2" background="../Images/BG-Border-Right.png" valign="top"><img src="../Images/BG-Border-RT.png" border="0"/></td>
            </tr>
            <tr>
                <td class="panel_body" >
                    <!--Panel Body-->
                    <table width="96%" border="0" cellpadding="3" cellspacing="0" >
                        <tr>
                            <td align="left">
                                <asp:Label ID="LabelOperationLog" runat="server">操作类型:<br />Operation Type:</asp:Label>
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="drpmodule" runat="server" Width="150px" AutoPostBack="false">
                                </asp:DropDownList>
                            </td>
                            <td align="left">
                                <asp:Label ID="LabelOperationDate" runat="server">操作时间:<br />Operation Date:</asp:Label>
                            </td>
                            <td align="left">From:
                                <asp:TextBox ID="txtstartdate" runat="server" Width="150px" CssClass="cssPopdate" checkmaster="checkDate" allowempty="true" IconID="DateIcon01" ></asp:TextBox>&nbsp;<img id="DateIcon01"
                                                    class="DateIcon" src="../Images/calendar_18.gif" />
                            
                                <asp:Label ID="LabelTo" runat="server"> To:</asp:Label>
                            
                                <asp:TextBox ID="txtenddate" runat="server" Width="150px" CssClass="cssPopdate" checkmaster="checkDate" allowempty="true" IconID="DateIcon02" ></asp:TextBox>&nbsp;<img id="DateIcon02"
                                                    class="DateIcon" src="../Images/calendar_18.gif" />
                            </td> 
                            <td></td>
                                                 
                        </tr>
                        <tr>

                            <td align="left">
                                <asp:Label ID="LabelUserName" runat="server">用户名:<br />User Name:</asp:Label>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtename" runat="server" Width="150px" CssClass="cssText" allowempty="true" checkmaster="checkbadwords"></asp:TextBox>
                            </td>                           
                            <td colspan="2" align="left"><asp:RadioButton ID="rbtLast" runat="server" Text="最后一次操作(Last Operation)" GroupName="rbtMain" Checked ="true" /><asp:RadioButton ID="rbtAll" runat="server" Text="所有操作(All Operation)" GroupName="rbtMain" />　</td>
                            
                            
                            <td align="right" ><asp:Button ID="btn_search" OnClick="btn_search_Click"  autopostback="false" CssClass="bgButton" runat="server" Text="Search" isvalidate="true"/></td>
                             
                        </tr>
                    </table>
                    
                </td>
            </tr>
            <tr>
                <td height="5" background="../Images/BG-Border-Bottom.png" align="left"><img src="../Images/BG-Border-LB.png" border="0"/></td>
        <td width="5" height="5" background="../Images/BG-Border-RB.png"></td>
            </tr>
        </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td class="panel_header">
                <!--标题-->
                <asp:Label ID="lb_hd2" runat="server">日志(Logs)</asp:Label>
                <!--标题-->
                </td><td width="5" rowspan="2" background="../Images/BG-Border-Right.png" valign="top"><img src="../Images/BG-Border-RT.png" border="0"/></td>
            </tr>
            <tr>
                <td class="panel_body" >
                    <asp:Panel ID="logPanel" runat="server" Width="98%" Visible="false" Height="100%">
                    <div id="divReport" runat="server" style="overflow:auto;" >                  
                    <table width="100%" align="center">
                    <tr>
                        <td><br />
                            <asp:GridView ID="logdataGridView" runat="server" Width="100%" HorizontalAlign="Center" AllowPaging="True" AutoGenerateColumns="False">
                                <HeaderStyle CssClass="table_header" />
                                        <RowStyle CssClass="table_row_1" />
                                        <AlternatingRowStyle CssClass="table_row_2" />
                                        <SelectedRowStyle CssClass="table_row_select" />
                                <PagerSettings Visible="False"></PagerSettings>
                                <EmptyDataTemplate>
                                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                                <td class="panel_header">
                                                                    <!--标题-->
                                                                    没有数据,请确认用户名是否正确.(No Data, Please make sure user name is correct.)
                                                                    <!--标题-->
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </EmptyDataTemplate>
                                <Columns>
                                    <asp:BoundField DataField="OperationType" HeaderText="操作类型&lt;br/&gt;Type" HtmlEncode="False">
                                         <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                         <HeaderStyle Wrap="False"></HeaderStyle>
                                    </asp:BoundField>
                                    
                                    <asp:BoundField DataField="LogContent" HeaderText="日志内容&lt;br/&gt;Log Content" HtmlEncode="False">
                                         <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                         <HeaderStyle Wrap="False"></HeaderStyle>
                                    </asp:BoundField>
                                    
                                    <asp:BoundField DataField="OperationDate" HtmlEncode="False" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" HeaderText="操作日期&lt;br/&gt;Date">
                                         <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                         <HeaderStyle Wrap="False"></HeaderStyle>
                                    </asp:BoundField>
                                    
                                    <asp:BoundField DataField="EmployeeName" HeaderText="操作人姓名&lt;br/&gt;Name" HtmlEncode="False">
                                         <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                         <HeaderStyle Wrap="False"></HeaderStyle>
                                    </asp:BoundField>
                                    
                                    <asp:BoundField DataField="HostName" HeaderText="主机&lt;/br&gt;Host" HtmlEncode="False">
                                         <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                         <HeaderStyle Wrap="False"></HeaderStyle>
                                    </asp:BoundField>
                                    
                                    <asp:BoundField DataField="HostIP" HeaderText="主机IP&lt;br/&gt;Host IP" HtmlEncode="False">
                                         <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                         <HeaderStyle Wrap="False"></HeaderStyle>
                                    </asp:BoundField>
                                </Columns>
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <uc1:Pager id="pgoperationlog" runat="server"></uc1:Pager>
                        </td>
                    </tr>
                    </table>
                    </div>
                </asp:Panel>
            </td>
        </tr>
        </table>
    </td>
</tr>
</table>
</div>

<script language="javascript">
    //OnClick="btn_search_Click"
    //CssClass="bgButton"
    function CheckInput()
    {
        var dtStart=document.getElementById("ctl00_ContentPlaceHolder1_txtstartdate");
        var dtEnd=document.getElementById("ctl00_ContentPlaceHolder1_txtenddate");
        if (dtStart!=null)
        {
        
           if (dtStart.value!="" && checkDate(dtStart)!='success')
           {
                alert("请输入正确的日期!\nPlease specify a correct date!");
                event.returnValue=false;
                return false;
           }
        }
        if (dtEnd!=null)
        {
           if (dtEnd.value!="" && checkDate(dtEnd)!="success")
           {
                alert("请输入正确的日期!\nPlease specify a correct date!");
                event.returnValue=false;
                return false;
           }
        }   
        
        var btn=document.getElementById("ctl00_ContentPlaceHolder1_btn_search");
        btn.removeAttribute("autopostback");

             
        //event.returnValue=false;
    }
    

    window.attachEvent("onresize",resizeFunc1); 
    resizeFunc1();
function resizeFunc1()
{
    var parentWin=window.parent;
    if (parentWin!=null)
    {
        var ofrm=parentWin.document.getElementById("main");
        if (ofrm!=null)
        {
        
            var sHeight=ofrm.document.body.offsetHeight;
            var sWidth=ofrm.document.body.offsetWidth;
         
            var divReport=document.getElementById("ctl00_ContentPlaceHolder1_divReport");
            if (divReport!=null)
            {
                divReport.style.width=sWidth-280;
                divReport.style.height=sHeight-310;
            }
        }
    }
}    
    
    
    
</script>
</asp:Content>
